import React from "react";


class Weather2 extends React.Component {


    state = {
        isHot: true
    }

    changeWeather = () => {
        let {isHot} = this.state;
        this.setState({isHot: !isHot})
    }


    render() {
        let {isHot} = this.state;
        return (
            <>
                <h3>今天天气很<span onClick={this.changeWeather}>{isHot ? "炎热" : "寒冷"}</span></h3>
            </>
        );
    }
}

export default Weather2;